<?php
/**
 * Created by PhpStorm.
 * User: xupeng
 * Date: 2016/7/13
 * Time: 10:17
 */

namespace Home\Controller;


use Think\Controller;

class AddressController extends LoginBaseController
{
    /**
     * 新增地址页面
     */
    public function addressInfo()
    {
    	$dealer_channel=I('dealer_channel');
        $user = M('user_info')->where('user_id = "%s"', I('user_id'))->find();

        $address = array('consignee_name' => $user['real_name'],
            'user_id' => $user['user_id']);
        $this -> assign('operate_name','新增地址');
        $this -> assign('address',$address);
        $this->assign("dealer_channel",$dealer_channel);
        $this -> display('user/addressinfo');
    }

    /**
     * 新增地址页面
     */
    public function updateAddressPage()
    {
        $address = M('user_address')->where('address_id = "%s"', array(I('address_id')))->find();
        $this->assign('address', $address);
        $this -> assign('operate_name','更新地址');

        $this -> display('user/addressinfo');
    }



    /**
     * 跳转至查询界面
     */
    public function listAddress(){

        $user = M('user_info')->where('user_id = "%s"', array(I('user_id')))->find();
        $this -> assign('user_id' , I('user_id'));
        $this -> assign('consignee_name' , $user['real_name']);

        $this -> display('user/addresslist');
//        $this->ajaxReturn('');
    }

}